package com.yanqu.road.server.manager.activity.commonsupport.handler;

import com.yanqu.road.entity.activity.unionwar.cross.CrossUnionWarSimple;
import com.yanqu.road.logic.helper.UnionActivityGroupHelper;
import com.yanqu.road.server.manager.union.activitygroup.Cross2UnionActivityGroupMgr;
import com.yanqu.road.server.manager.unionwar.CrossUnionWarMgr;

/**
 * 群英争霸
 */
public class QunYingSupportActivityHandler extends SupportActivityHandler {

    @Override
    public boolean ableUnion(int activityId, int groupId, String unionUid) {
        CrossUnionWarSimple warSimple = CrossUnionWarMgr.getCrossUnionWarSimple(activityId, unionUid);
        if(warSimple != null){
            return true;
        }
        return false;
    }

    @Override
    public boolean ableUser(int activityId, int groupId, long userId) {
        int gid = Cross2UnionActivityGroupMgr.getGroupId(activityId, userId);
        return UnionActivityGroupHelper.NO_GROUP_ID != gid;
    }
}
